package com.example.myproject;



public class VideoUpload {
	
	public VideoUpload(){}
	
	/** 
	 * video file upload to datastore VideoUploadDAO
	 * @param master
	 * @param episode
	 * @param series
	 * @return boolean
	 */
	public boolean upload(UploadDTO master, String episode, String series)
	{
		try {
			
			VideoUploadDTO video = new VideoUploadDTO();
			VideoUploadDAO dao = new VideoUploadDAO();
			
			video.setTitle(master.getTitle());
			video.setCaption(master.getCaption());
			video.setContentType(master.getContentType());
			video.setPath(master.getPath());
			video.setParentId(master.getId());
			video.setEpisode(episode);
			video.setSeries(series);
			dao.save(video);
			
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		
		return true;
	}
}
